home *** CD-ROM | disk | FTP | other *** search
/ Linux Programs 1995 Summer / Linux Programs.iso / postgres / postgres.rea < prev   
Text File  |  1995-04-15  |  19KB  |  514 lines

  1. Readme for the Postgres port to Linux.
  2.  
  3. Q: What is most important?
  4. --------------------------
  5. You need IPCDELTA (or any newer version, of course). Read below
  6. under Q: Kernel?
  7.  
  8. Q: What is also important?
  9. --------------------------
  10. You need a running tcp/ip network, at least for the loopback
  11. device. The files necessary to set up the later are included in
  12. both the binary and source package, in the archive loopback.tar.
  13.  
  14. Q: Which packages do I need?
  15. ----------------------------
  16. postgres4.0.1a.doc.tar.z:   documentation, get it.
  17. postgres4.0.1a.demo.tar.z:  demos, get them.
  18. postgres4.0.1a.bin.tar.z:   binaries.
  19. postgres4.0.1a.libpq.tar.z: libraries for application development.
  20. postgres4.0.1a.src.tar.z:   The source code, of course.
  21.  
  22. You need the libpq package, if you want to access the database
  23. from C code. It contains all global header files, as well as the
  24. static libpq.a library. You don't need this package, if you get
  25. the source.
  26.  
  27. Version summary
  28. ---------------
  29. Postgres:    4.0.1
  30. This port:    0.1
  31. Linux Kernel:    0.99.7 or higher (for IPCDELTA)
  32. IPC:        Delta
  33. Shared Libs:    4.3.3
  34.  
  35. Quick Installation Guide:
  36. -------------------------
  37. - Get IPCDELTA into your kernel.
  38. - Run "patch <'this_file'" from the /usr/src/linux directory.
  39. - Recompile the kernel.
  40. - Create a user named postgres, user id 6 (!), with /bin/tcsh as Shell.
  41. - Make /usr/postgres be his or her home directory, or a symlink to it.
  42. - Give him a .login, which sets POSTGRESHOME to the home directory, and
  43.   puts $POSTGRESHOME/bin into his PATH.
  44. - Unpack the postgres4.0.1a.doc.tar.z in this directory.
  45. - Get and unpack the demos postgres4.0.1a.demo.tar.z, too.
  46. - Unpack either postgres4.0.1a.src.tar.z or postgres4.0.1a.bin.tar.z.
  47. - Run the sripts moveme.[doc|src|bin|libpq|demo], if you're not on a
  48.   Minix filesystem (to get all long names right).
  49. - Read the setup.me in the doc section.
  50. - If you have the binary distribution, run initdb.
  51. - With the source, cd to newconf; type Make install; wait.
  52. - Have fun!
  53. - Don't flame me!
  54.  
  55. E-Mail:
  56. -------
  57. This is the first release of a Postgres port to Linux. Please report
  58. success or failure, bug reports, and - better - bug fixes to:
  59. Kai Petzke, wpp@marie.physik.tu-berlin.de
  60.  
  61. [Stop reading now, if you don't like README's]
  62.  
  63. Q: What is Postgres?
  64. --------------------
  65. Postgres is a relational database management system. It has many
  66. of new ideas inplemented, among them are:
  67.  
  68. - dynamic loading of datatypes and functions into the database
  69.   (for example, you could define complex numbers as datatypes,
  70.   provide all the function for complex arithmetics, and then
  71.   retrieve all records, where the absolute value of the exponent
  72.   of one field is bigger than a given value ...).
  73.  
  74. - A transaction level rule system (say you got two relations
  75.   (= database tables), one containing the accounts with the
  76.   totals, one with the bookings. You could then write a rule,
  77.   that always updates the totals, when a new booking is inserted).
  78.  
  79. - A transparent history system, so you can query the state of
  80.   the database at any time in the past (unless you use the
  81.   vacuum cleaner, which slurps up all the outdated stuff ...).
  82.  
  83. - Support for Write Once, Read Multiple (WORM) storage devices.
  84.  
  85. - Many, many others ...
  86.  
  87. Refer to the postgres.FAQ at the bottom of this README for more
  88. information.
  89.  
  90. Q: Space requirements?
  91. ----------------------
  92. Binaries:    2 MB HD Space + Database space
  93.         4 MB RAM + some swap, if nothing else is running.
  94.         (maybe more, I have 8 MB and did not test with 4)
  95.  
  96. Docs:        a) troff source:    2 MB HD
  97.         b) postscript dump: 2 MB HD
  98.  
  99. Q: Kernel?
  100. ----------
  101.  
  102. a) IPC
  103. ------
  104. The version of your kernel should be uncritical, but you must
  105. have SYS/V IPC (Inter-Process-Communication) compiled into it.
  106. The current version of this package, ipcdelta, goes straightforward
  107. into 99pl7, needs one patch to be applied by hand for 99pl8, and
  108. so are two for 99pl9. Read the IPCDELTA's READMEs on how to install
  109. the package.
  110.  
  111. Special instructions for 99pl8 and 99pl9 only:
  112. ----------------------------------------------
  113. Don't try to apply the patches in the file named fsync.cd - there
  114. is already a dumb function definition for fsync in the kernel
  115. sources. There is one patch on the file kernel/sys.c, which fails.
  116. It deletes a dumb definition of the ipc call. Look for the lines:
  117.  
  118. int sys_ipc(void)
  119. {
  120.     return -ENOSYS;
  121. }
  122.  
  123. in kernel/sys.c, and delete them by hand.
  124.  
  125. Special instructions for 99pl9 only:
  126. ------------------------------------
  127. Replace "copy_page_tables" by "copy_vm" in the ipc.cd file,
  128. *before* you apply the patches in this file. Otherwise, a patch
  129. to the file kernel/fork.c fails. Don't try to use the clone()
  130. system call with processes, which use ipc ...
  131.  
  132. Back to all kernels:
  133. --------------------
  134. There is a bug in ipcdelta, which breaks Postgres. Apply the
  135. following patch, before you recompile the kernel: (Don't cut this
  136. file to pieces. Fed it as a whole, as is, to patch, and realize,
  137. that this clever program still does the right thing!)
  138.  
  139. --- ipc/sem.old.c    Tue Mar 16 18:56:14 1993
  140. +++ ipc/sem.c    Fri Apr 16 15:50:47 1993
  141. @@ -276,7 +276,7 @@
  142.              return -EACCES;
  143.          for (i=0; i< sma->sem_nsems; i++)
  144.              sem_io[i] = sma->sem_base[i].semval;
  145. -        memcpy_tofs (sem_io, array, nsems*sizeof(ushort));
  146. +        memcpy_tofs (array, sem_io, nsems*sizeof(ushort));
  147.          break;
  148.      case SETVAL:
  149.          if (ipcperms (ipcp, 0222))
  150. @@ -316,6 +316,8 @@
  151.              wake_up (&sma->eventn);
  152.          if (sma->eventz)
  153.              wake_up (&sma->eventz);
  154. +        for (i=0; i < nsems; i++)
  155. +            sma->sem_base[i].semval = sem_io[i];
  156.          sma->sem_ctime = CURRENT_TIME;
  157.          break;
  158.      default:
  159.  
  160. For the Postgres binaries, you won't need to build the libipc.a
  161. library, but you might need the ipcs and ipcrm utilities to
  162. clear up the ipc stuff after a Postgres crash.
  163.  
  164. b) TCP/IP
  165. ---------
  166. You need it, so don't build a kernel without it.
  167.  
  168. c) fsync()
  169. ----------
  170. There are kernel patches, which implement this function call.
  171. Postgres by default uses fsync() after each write() to write
  172. the data to disk, but I've commented these out for the current
  173. version of Postgres (ipcdelta was enough kernel patching) ...
  174.  
  175. Q: Libraries:
  176. -------------
  177. Sorry, I linked everything with the 4.3.3 shared libs, so you
  178. need these in order to run the binary distributed Postgres.
  179.  
  180. Q: How do I install Postgres?
  181. -----------------------------
  182. Get the docs and demos, and either the binaries or sources. Get
  183. libpq, too, if you use the binary distribution, and if you want
  184. to use Postgres from C Programs. To unpack any of these packages,
  185. type the following in the Postgres home directory:
  186.     zcat postgres4.0.1a.???.tar.z | gtar xfv -
  187.  
  188. There are detailed instructions on the initial setup of Postgres
  189. in the file doc/postgres-setup.me. To view it, type:
  190.     groff -Tascii -me doc/postgres-setup.me | less
  191. There is almost nothing, which is Linux-specific (apart from the
  192. section about IPC).
  193.  
  194. Q: And if user ID 6 is already used by someone else?
  195. ----------------------------------------------------
  196. Give the old user with this ID a new one. Execute the following:
  197.     chown new_user-ID `find / -uid 6`
  198.  
  199. Q: Loopback network setup?
  200. --------------------------
  201. There is a file named "loopback.tar" in both the binary and
  202. source distribution. Type "gtar tf loopback.tar", to get a list
  203. of the files in it, and save all the files and directories, which
  204. have any of the names in this list.
  205.  
  206. Then delete the directories /usr/etc/inet and /etc/inet, and
  207. unpack the loopback.tar archive with:
  208.     gtar -C / -x -f loopback.tar
  209.  
  210. Last step: edit /etc/hosts and /etc/resolv.conf to represent your
  211. hostname (my was safran). However, the domain name does not matter
  212. at all. Include the line:
  213.     sh /etc/rc.net
  214. in your /etc/rc.local or /etc/rc file.
  215.  
  216. Q: Compiling myself?
  217. --------------------
  218. If you want to compile the baby yourself, you should have at
  219. least 4 MB of *free* RAM. You need at least 20 MB of disk space.
  220. To compile everything with the debugger option -g you should have
  221. about 50 MB HD and 16 MB Ram. Without the later, gdb is of almost
  222. no use, as the symbol gets too big.
  223.  
  224. You need tcsh, a pwd executable, the getopt command, Berkeley Yacc,
  225. flex, cb, and bug-fixed versions of awk (2.14 or newer) and sed
  226. (1.13 or newer). You can find out awk's version with "awk -V" or
  227. "awk -W version". If you get an error message as answer, you are
  228. very likely to have an old version ... Check "sed -V" as well.
  229.  
  230. If you don't have cb ("beautifies" C programmes - does nothing but
  231. change the spacing of its input), make it a shell script with the
  232. single line: cat
  233.  
  234. I used Berkeley Yacc to compile Postgres. I did not even try bison,
  235. so you might have good luck or not. Berkeley Yacc is usually in a
  236. package called byacc, which you could find with the Ingres Port
  237. (which it was used for, too).
  238.  
  239. The usual work-around for missing pwd ("alias pwd 'echo $cwd'" in
  240. your .cshrc) does not work with the C-Shell scripts of Postgres. I
  241. supply two fast hacks for pwd (written by me - really no problem),
  242. and getopt in a file called commands.tar.
  243.  
  244. Some shell scripts use full path names, and you are likely to have
  245. some of these binaries somewhere else. So check, that
  246. /usr/bin/awk
  247. /usr/bin/bc
  248. /usr/bin/lex
  249. /usr/bin/yacc
  250. /bin/sed
  251. exist, or are links to the real locations of these. Also, check
  252. that /lib/cpp is a link to an existing C Preprocessor (you might
  253. have forgotten to update this link, when you upgraded to a new
  254. version of Gnu CC).
  255.  
  256. The Postgres FAQ:
  257. -----------------
  258.                  Frequently Asked Questions about Postgres
  259.  
  260. Q:  What Is Postgres?
  261.  
  262.     Postgres is a database research project under Prof. Michael Stonebraker
  263.     at U. C. Berkeley.  To facilitate research efforts, a software test-bed was
  264.     created; this is the "Postgres" DBMS software.  The Postgres DBMS
  265.     is extended relational or object oriented, depending on the buzzword du
  266.     jour.
  267.  
  268.     The major purpose of this software is to provide a platform and a basis
  269.     for the testing of implementations of new ideas in database research.
  270.     Several graduate students, staff members, as well as undergraduate
  271.     programmers have been working on the implementation of the Postgres
  272.     software.  After this paragraph, all references to "Postgres" refer to the
  273.     software itself.
  274.  
  275. Postgres Is:
  276.  
  277. o  Relational.  One of the major goals of Postgres is to show that
  278.    an essentially relational DBMS can be extended to handle complex objects,
  279.    rules, and be highly extensible.
  280.  
  281. o  Highly extensible.  Postgres allows user-defined operators, user-defined
  282.    objects, and user-defined functions.
  283.  
  284. o  While Postgres is relational, object oriented ideas have been implemented
  285.    in Postgres (inheritance, etc).
  286.  
  287. o  Numerous other features, such as query language procedures, rules, etc.
  288.    which are beyond the scope of this discussion.
  289.  
  290.    For more info on the Postgres research itself, you can get the
  291.    Postgres technical documentation described below.
  292.  
  293. Q.  What is the connection between Postgres and Ingres?
  294.  
  295. A.  There is none, aside from Prof. Stonebraker.  There is no compatibility
  296.     between the two software packages, and the research projects have
  297.     differing objectives.  We do not support University Ingres at all;
  298.     questions about it should be sent to the USENET group "comp.databases".
  299.  
  300. Q.  How do I get the Postgres software package?
  301.  
  302. A.  In one of two ways:
  303.  
  304.     1.  Via anonymous FTP from postgres.berkeley.edu (Internet 128.32.149.1);
  305.         the important files are
  306.  
  307.         pub/postgres-v4r0r1.tar.Z  (Note: should be transmitted in BINARY mode.)
  308.         pub/postgres-setup.me
  309.  
  310.     2.  If you don't have Internet access, you can get Postgres by sending
  311.         a check for US $150 payable to
  312.  
  313.         Regents of the University of California
  314.  
  315.         This should be addressed to
  316.  
  317.         The Postgres Project
  318.         557 Evans Hall
  319.         University of California
  320.         Berkeley, CA 94720
  321.  
  322.         Indicate in your accompanying letter whether you want the system on a
  323.         9-track tape at 1600 BPI, at 6250 BPI, on a Sun cartridge tape (QIC 24
  324.         format), or on a TK50 DEC cartridge tape.
  325.  
  326.     Sorry - we cannot deliver Postgres via e-mail.
  327.  
  328. Q.  What is the Postgres query language?
  329.  
  330. A.  Postquel, which is an incompatible superset of Quel.
  331.  
  332. Q.  What about SQL support?
  333.  
  334. A.  We do not support SQL at this time.
  335.  
  336. Q.  What does Postgres run on?
  337.  
  338. A.  Postgres 4.0.1 is supported on Sun 4, Sparc, and DECstations running Ultrix
  339.     4.0 or higher.  Ports are distributed (but not supported) for Sun 3's and
  340.     Sequent Symmetry machines.  We are aware of ports for Solbourne (a Sparc
  341.     multiprocessor), MIPS workstations, and the Sun 386i, although we do _not_
  342.     have access to these ports and do not intend to support them.  
  343.  
  344.     The experience of outside developers indicates that Postgres is relatively
  345.     easy to port to any system that supports:
  346.  
  347.     1.  Berkeley-style sockets
  348.     2.  System V shared memory and semaphores
  349.     3.  A K & R compatible C compiler
  350.     4.  Other "normal" Unix system calls 
  351.  
  352.     Some header file problems may be encountered; these are easily fixed by
  353.     a programmer knowledgable with the local OS.  The most difficult part
  354.     of the port is porting the dynamic object code loader, which requires
  355.     interpreting object file headers.
  356.  
  357. Q.  How do I get papers about Postgres?
  358.  
  359. A.  On postgres.berkeley.edu is a file called
  360.  
  361.     pub/postgres-papers.tar.Z
  362.  
  363.     which contains troff and Postscript versions of several of the major
  364.     Postgres technical reports.  If you don't have Internet access, you can
  365.     order hard-copies of technical reports individually; for more details,
  366.     send e-mail or call Sarah Burke at (510) 642-3417; her e-mail address
  367.     is 
  368.     
  369.         sarahb@postgres.berkeley.edu
  370.  
  371. Q.  What is the status of the Postgres implementation?
  372.  
  373. A.  It is not up to commercial levels of reliability.  I would not want
  374.     _my_ payroll records in it :-)  However, it is quite adaquate for
  375.     managing scientific and experimental datasets and as an instructional
  376.     system.  Its speed on applications which stress transaction processing
  377.     is not particularly good, but it is within about 50% of commercial systems
  378.     on the more "report-oriented" Wisconsin benchmark, and is twice as fast
  379.     as University Ingres on the Wisconsin.
  380.  
  381. Q.  Does Postgres have a user interface?  A report generator?
  382.  
  383. A.  No and no, not as shipped.
  384.  
  385. Q.  What about a C-callable interface for writing applications?
  386.  
  387. A.  There most definitiely is one, called libpq.  There is also an interface
  388.     for referencing Postgres data from shell scripts.  Get the Postgres
  389.     reference manual for details.
  390.  
  391. Q.  Is there a BBS/discussion group about Postgres?
  392.  
  393. A.  Yes - the mailing list
  394.  
  395.         postgres@postgres.berkeley.edu
  396.  
  397.     has over two hundred readers and gateways; you can subscribe to the mailing
  398.     list by sending mail to 
  399.  
  400.         postgres-request@postgres.berkeley.edu
  401.  
  402.     with "ADD" as the Subject.
  403.  
  404.     You UNsubscribe from the mailing list by sending mail to
  405.  
  406.         postgres-request@postgres.berkeley.edu
  407.  
  408.     with "DEL" as the Subject.
  409.  
  410. Q.  How do I make a bug report?
  411.  
  412. A.  If you find a bug, send a description of your database schema, queries,
  413.     and a stack dump (type "where" in DBX) if possible to 
  414.  
  415.         bug-postgres@postgres.berkeley.edu
  416.  
  417. Q.  How do I find out about known bugs?
  418.  
  419. A.  The known bug list is on Postgres in the file
  420.  
  421.         pub/postgres-v4r0r1.bugs
  422.  
  423. Q.  Please summarize the important files on postgres.berkeley.edu
  424.  
  425. A.  File                         Purpose
  426.  
  427.     pub/postgres-v4r0r1.tar.Z    Complete Postgres distribution
  428.     pub/postgres-v4r0r1.bugs     Postgres 4.0.1 known bug list and workarounds
  429.     pub/postgres-setup.me        Postgres Installation instructions in troff
  430.     pub/postgres-papers.tar.Z    Postgres papers
  431.  
  432.     pub/picasso-README           Instructions for getting Picasso
  433.  
  434. Q.  Please summarize the important Postgres mailing aliases
  435.  
  436. A.  Mailing Address              Purpose
  437.  
  438.     postgres@postgres            Postgres general discussion and announcements
  439.     postgres-request@postgres    Administrative requests (ADD/DEL)
  440.     bug-postgres@postgres        Postgres bug reports
  441.     postgres-questions@postgres  Questions to the developers of Postgres
  442.  
  443.     picasso@postgres             Questions to the Picasso group
  444.  
  445. Q.  Please summarize the main contacts at the Postgres group
  446.  
  447. A.  Address/Phone                 Role
  448.  
  449.     Marc Teitelbaum          Postgres Chief Programmer 
  450.     marc@postgres.berkeley.edu    
  451.     (510) 643-6138
  452.  
  453.     Sarah Burke              Assistant to the Postgres group
  454.     sarahb@postgres.berkeley.edu
  455.     (510) 642-3417
  456.  
  457. Comments an the postgres.faq:
  458. -----------------------------
  459. The postgres.faq says:
  460.     The experience of outside developers indicates that Postgres is relatively
  461.     easy to port to any system that supports:
  462.  
  463.     1.  Berkeley-style sockets
  464.     2.  System V shared memory and semaphores
  465.     3.  A K & R compatible C compiler
  466.     4.  Other "normal" Unix system calls 
  467.  
  468.     Some header file problems may be encountered; these are easily fixed by
  469.     a programmer knowledgable with the local OS.  The most difficult part
  470.     of the port is porting the dynamic object code loader, which requires
  471.     interpreting object file headers.
  472.  
  473. The reverse was true: I had trouble with almost anything, but the
  474. dynamic object code loader was easy, as Linux uses an executable
  475. format similiar to that of a sun. Many Header files contained wrong
  476. prototypes, so I had indeed to fix lots of header file problems,
  477. not with Linux, but Postgres.
  478.  
  479. It seems, that Linux and gcc are very strict with floating point
  480. data types. Lots of #include's were missing, so floating point
  481. values weren't fetched off the FPU stack, which lead to a floating
  482. point exception soon. Functions like log(x) were called with x = 0,
  483. which produced core files, too. The same expressions must run on
  484. Sparcstations with much less trouble.
  485.  
  486. The worst thing was to move from standard unix lex to flex. Don't
  487. believe, that the Postgres scanner scans a query word by word from
  488. the left to the right!
  489.  
  490. Bugs:
  491. -----
  492. The Postgres V4.0.1 was only a bug fix release relative to 4.0,
  493. so don't believe, you will have a robust database system with this
  494. version of Postgres. Also note, that this port is an ALPHA release.
  495. However, there are no bugs known to me, apart those mentioned in
  496. doc/release.4.0.1. I tried my best to make this port clean, but if
  497. you find bugs, please e-mail to:
  498.  
  499. Kai Petzke, wpp@marie.physik.tu-berlin.de
  500.  
  501. Questions, Problems:
  502. --------------------
  503. Feel free to ask, but please read this readme, the Linux' FAQs
  504. and postgres-setup.me before you bomb me with e-mail. Please be
  505. patient, I read e-mail two or three times a week only.
  506.  
  507. Future Plans:
  508. -------------
  509. 1) Make this port stable.
  510. 2) Port picasso, the graphical front-end under X.
  511. 3) Upgrade to the newer Postgres release 4.1.
  512.  
  513. Have fun!
  514.